package com.cc.service;

import com.cc.dao.UserRepository;
import com.cc.po.User;
import com.cc.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by zcc on 202/12/17.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired//注入对象
    private UserRepository userRepository;
//检查是否登录
    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
        return user;
    }
}
